<% if @namespace.errors.empty? %>
  var el = $(".button_namespace_description i.fa");
  $("#change_description_namespace_<%= @namespace.id %>").fadeToggle(function() {
    $(".description").fadeToggle();
  });
  el.removeClass('fa-close');
  el.addClass('fa-pencil');
  <% if @namespace.description.blank? %>
    $('.description').html("No description has been posted yet");
  <% else %>
    $('.description').html("<%= escape_javascript(markdown(@namespace.description)) %>");
  <% end %>

  $("#team-label a").replaceWith("<%= escape_javascript(link_to(@namespace.team.name, @namespace.team)) %>")
<% else %>
  $('#float-alert p').html("<%= escape_javascript(@namespace.errors.full_messages.join('<br/>')) %>");
  $('#float-alert').fadeIn(setTimeOutAlertDelay());
<% end %>
